package com.example.warehousems.dao.model;

import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

@Entity
@Table(name = "storage")
@Data
@NoArgsConstructor
@AllArgsConstructor
@IdClass(StorageCoKey.class)
public class Storage {
    @Id
    @Column(length = 2)
    private String shelf;
    @Id
    private Integer floor;
    @Id
    private Integer number;

    @OneToOne()
    @JoinColumn(name = "cargo_id")
    private Cargo cargo;

    private Integer status; // 0: empty, 1: occupied
}
